From 66df8d5012ef7117630b25f98df20d26061fe359 Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Fri, 19 Nov 2004 18:53:59 +0000 Subject: [PATCH] bitkeeper revision 1.1159.179.15 (419e4147MLxxTvBc9zlN1KN3pUk7BA) setup_arch_post.h: clear feature sep flag to avoid modification to sysenter.c Makefile: g/c unmodified vmlinux.lds ioremap.c, fault.c, timer_tsc.c, setup.c, ldt.c: Whitespace. traps.c: Whitespace and remove unused code. head.S: writable pagetables are always enabled Makefile: g/c unmodified vmlinux.lds and sysenter.c .del-sysenter.c~4edabffbf333447d: Delete: linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/sysenter.c .del-vmlinux.lds.S~a6e49b85e6684b9a: Delete: linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vmlinux.lds.S --- .rootkeys | 2 - .../arch/xen/i386/kernel/Makefile | 6 +- .../arch/xen/i386/kernel/head.S | 4 - .../arch/xen/i386/kernel/ldt.c | 4 +- .../arch/xen/i386/kernel/setup.c | 2 +- .../arch/xen/i386/kernel/sysenter.c | 65 ----- .../arch/xen/i386/kernel/timers/timer_tsc.c | 12 +- .../arch/xen/i386/kernel/traps.c | 66 +---- .../arch/xen/i386/kernel/vmlinux.lds.S | 134 --------- .../arch/xen/i386/mm/fault.c | 6 +- .../arch/xen/i386/mm/ioremap.c | 254 +++++++++--------- .../arch/xen/kernel/Makefile | 6 +- .../asm-i386/mach-xen/setup_arch_post.h | 1 + 13 files changed, 155 insertions(+), 407 deletions(-) delete mode 100644 linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/sysenter.c delete mode 100644 linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vmlinux.lds.S diff --git a/.rootkeys b/.rootkeys index 9745d45e2b..83246e5d43 100644 --- a/.rootkeys +++ b/.rootkeys @@ -148,12 +148,10 @@ 40f56238a8iOVDEoostsbun_sy2i4g linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/process.c 40f56238YQIJoYG2ehDGEcdTgLmGbg linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/setup.c 40f56238nWMQg7CKbyTy0KJNvCzbtg linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/signal.c -40f56238UL9uv78ODDzMwLL9yryeFw linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/sysenter.c 40f56238qVGkpO_ycnQA8k03kQzAgA linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/time.c 40f56238NzTgeO63RGoxHrW5NQeO3Q linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/timers/Makefile 40f56238BMqG5PuSHufpjbvp_helBw linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c 40f562389xNa78YBZciUibQjyRU_Lg linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/traps.c -40f56238qASEI_IOhCKWNuwFKNZrKQ linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vmlinux.lds.S 40f56238JypKAUG01ZojFwH7qnZ5uA linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vsyscall.S 40f56238wi6AdNQjm0RT57bSkwb6hg linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vsyscall.lds 40f56238a3w6-byOzexIlMgni76Lcg linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/Makefile diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/Makefile b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/Makefile index 8e18bc5f13..014f324cc1 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/Makefile +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/Makefile @@ -6,7 +6,7 @@ XENARCH := $(subst ",,$(CONFIG_XENARCH)) CFLAGS += -Iarch/$(XENARCH)/kernel -extra-y := head.o init_task.o vmlinux.lds +extra-y := head.o init_task.o obj-y := process.o signal.o entry.o traps.o \ time.o ioport.o ldt.o setup.o \ @@ -35,7 +35,7 @@ c-obj-$(CONFIG_X86_IO_APIC) += io_apic.o c-obj-$(CONFIG_X86_NUMAQ) += numaq.o c-obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o c-obj-$(CONFIG_MODULES) += module.o -obj-y += sysenter.o +c-obj-y += sysenter.o obj-y += vsyscall.o c-obj-$(CONFIG_ACPI_SRAT) += srat.o c-obj-$(CONFIG_HPET_TIMER) += time_hpet.o @@ -46,8 +46,6 @@ EXTRA_AFLAGS := -traditional c-obj-$(CONFIG_SCx200) += scx200.o -CPPFLAGS_vmlinux.lds += -U$(XENARCH) - # vsyscall.o contains the vsyscall DSO images as __initdata. # We must build both images before we can assemble it. # Note: kbuild does not track this dependency due to usage of .incbin diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/head.S b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/head.S index 1259369c03..b8ac0568da 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/head.S +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/head.S @@ -4,9 +4,7 @@ .section __xen_guest .ascii "GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=2.0,VIRT_BASE=0xC0000000" .ascii ",LOADER=generic" -#ifdef CONFIG_XEN_WRITABLE_PAGETABLES .ascii ",PT_MODE_WRITABLE" -#endif .byte 0 .text @@ -90,7 +88,6 @@ ENTRY(stack_start) .long init_thread_union+THREAD_SIZE .long __BOOT_DS -# XXXcl .globl idt_descr .globl cpu_gdt_descr @@ -99,7 +96,6 @@ ENTRY(stack_start) idt_descr: .word IDT_ENTRIES*8-1 # idt contains 256 entries .long idt_table -# XXXcl # boot GDT descriptor (later on used by CPU#0): .word 0 # 32 bit align gdt_desc.address diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/ldt.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/ldt.c index 1a762ce99b..1506972691 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/ldt.c +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/ldt.c @@ -125,8 +125,8 @@ void destroy_context(struct mm_struct *mm) if (mm == current->active_mm) clear_LDT(); make_pages_writable(mm->context.ldt, - (mm->context.size * LDT_ENTRY_SIZE) / - PAGE_SIZE); + (mm->context.size * LDT_ENTRY_SIZE) / + PAGE_SIZE); flush_page_update_queue(); if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE) vfree(mm->context.ldt); diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/setup.c index c9574a4311..2e16c1ff0d 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/setup.c +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/setup.c @@ -686,7 +686,7 @@ static void __init parse_cmdline_early (char ** cmdline_p) int len = 0; int userdef = 0; - memcpy(saved_command_line, xen_start_info.cmd_line, MAX_CMDLINE); + memcpy(saved_command_line, xen_start_info.cmd_line, MAX_CMDLINE); /* Save unparsed command line copy for /proc/cmdline */ saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/sysenter.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/sysenter.c deleted file mode 100644 index 93bdc0fe8c..0000000000 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/sysenter.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * linux/arch/i386/kernel/sysenter.c - * - * (C) Copyright 2002 Linus Torvalds - * - * This file contains the needed initializations to support sysenter. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -extern asmlinkage void sysenter_entry(void); - -void enable_sep_cpu(void *info) -{ - int cpu = get_cpu(); - struct tss_struct *tss = &per_cpu(init_tss, cpu); - - tss->ss1 = __KERNEL_CS; - tss->esp1 = sizeof(struct tss_struct) + (unsigned long) tss; - wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); - wrmsr(MSR_IA32_SYSENTER_ESP, tss->esp1, 0); - wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long) sysenter_entry, 0); - put_cpu(); -} - -/* - * These symbols are defined by vsyscall.o to mark the bounds - * of the ELF DSO images included therein. - */ -extern const char vsyscall_int80_start, vsyscall_int80_end; -extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; - -static int __init sysenter_setup(void) -{ - void *page = (void *)get_zeroed_page(GFP_ATOMIC); - - __set_fixmap(FIX_VSYSCALL, __pa(page), PAGE_READONLY_EXEC); - - if (1 /* XXXcl not yet */ || !boot_cpu_has(X86_FEATURE_SEP)) { - memcpy(page, - &vsyscall_int80_start, - &vsyscall_int80_end - &vsyscall_int80_start); - return 0; - } - - memcpy(page, - &vsyscall_sysenter_start, - &vsyscall_sysenter_end - &vsyscall_sysenter_start); - - on_each_cpu(enable_sep_cpu, NULL, 1, 1); - return 0; -} - -__initcall(sysenter_setup); diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c index 8ca7897c78..f885505a8b 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c @@ -67,10 +67,6 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc) return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; } -#if 0 -static int count2; /* counter for mark_offset_tsc() */ -#endif - /* Cached *multiplier* to convert TSC counts to microseconds. * (see the equation below). * Equal to 2^32 * (1 / (clocks per usec) ). @@ -93,13 +89,13 @@ static unsigned long get_offset_tsc(void) eax -= shadow_tsc_stamp; /* - * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient - * = (tsc_low delta) * (usecs_per_clock) - * = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy) + * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient + * = (tsc_low delta) * (usecs_per_clock) + * = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy) * * Using a mull instead of a divl saves up to 31 clock cycles * in the critical path. - */ + */ __asm__("mull %2" :"=a" (eax), "=d" (edx) diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/traps.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/traps.c index 8153348f5f..e7a58a8c64 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/traps.c +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/traps.c @@ -127,7 +127,7 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, addr = *stack++; if (__kernel_text_address(addr)) { printk(" [<%08lx>]", addr); - print_symbol(" %s\n", addr); + print_symbol(" %s", addr); printk("\n"); } } @@ -737,8 +737,8 @@ fastcall void do_debug(struct pt_regs * regs, long error_code) /* If this is a kernel mode trap, save the user PC on entry to * the kernel, that's what the debugger can make sense of. */ - info.si_addr = ((regs->xcs & 2) == 0) ? (void __user *)tsk->thread.eip : - (void __user *)regs->eip; + info.si_addr = ((regs->xcs & 2) == 0) ? (void __user *)tsk->thread.eip + : (void __user *)regs->eip; force_sig_info(SIGTRAP, &info, tsk); /* Disable additional traps. They'll be re-enabled when @@ -954,58 +954,6 @@ void __init trap_init_f00f_bug(void) } #endif -#define _set_gate(gate_addr,type,dpl,addr,seg) \ -do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \ - "movw %4,%%dx\n\t" \ - "movl %%eax,%0\n\t" \ - "movl %%edx,%1" \ - :"=m" (*((long *) (gate_addr))), \ - "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \ - :"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \ - "3" ((char *) (addr)),"2" ((seg) << 16)); \ -} while (0) - - -/* - * This needs to use 'idt_table' rather than 'idt', and - * thus use the _nonmapped_ version of the IDT, as the - * Pentium F0 0F bugfix can have resulted in the mapped - * IDT being write-protected. - */ -void set_intr_gate(unsigned int n, void *addr) -{ - _set_gate(idt_table+n,14,0,addr,__KERNEL_CS); -} - -#if 0 -/* - * This routine sets up an interrupt gate at directory privilege level 3. - */ -static inline void set_system_intr_gate(unsigned int n, void *addr) -{ - _set_gate(idt_table+n, 14, 3, addr, __KERNEL_CS); -} - -static void __init set_trap_gate(unsigned int n, void *addr) -{ - _set_gate(idt_table+n,15,0,addr,__KERNEL_CS); -} - -static void __init set_system_gate(unsigned int n, void *addr) -{ - _set_gate(idt_table+n,15,3,addr,__KERNEL_CS); -} -#endif - -#if 0 -static void __init set_task_gate(unsigned int n, unsigned int gdt_entry) -{ - _set_gate(idt_table+n,5,0,0,(gdt_entry<<3)); -} -#endif - /* NB. All these are "trap gates" (i.e. events_mask isn't cleared). */ static trap_info_t trap_table[] = { @@ -1030,14 +978,14 @@ static trap_info_t trap_table[] = { { 18, 0, __KERNEL_CS, (unsigned long)machine_check }, #endif { 19, 0, __KERNEL_CS, (unsigned long)simd_coprocessor_error }, - { SYSCALL_VECTOR, 3, __KERNEL_CS, (unsigned long)system_call }, - { 0, 0, 0, 0 } + { SYSCALL_VECTOR, 3, __KERNEL_CS, (unsigned long)system_call }, + { 0, 0, 0, 0 } }; void __init trap_init(void) { - HYPERVISOR_set_trap_table(trap_table); - HYPERVISOR_set_fast_trap(SYSCALL_VECTOR); + HYPERVISOR_set_trap_table(trap_table); + HYPERVISOR_set_fast_trap(SYSCALL_VECTOR); /* * default LDT is a single-entry callgate to lcall7 for iBCS diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vmlinux.lds.S b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vmlinux.lds.S deleted file mode 100644 index e0512cc8be..0000000000 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/vmlinux.lds.S +++ /dev/null @@ -1,134 +0,0 @@ -/* ld script to make i386 Linux kernel - * Written by Martin Mares ; - */ - -#include -#include -#include - -OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") -OUTPUT_ARCH(i386) -ENTRY(startup_32) -jiffies = jiffies_64; -SECTIONS -{ - . = __PAGE_OFFSET + 0x100000; - /* read-only */ - _text = .; /* Text and read-only data */ - .text : { - *(.text) - SCHED_TEXT - LOCK_TEXT - *(.fixup) - *(.gnu.warning) - } = 0x9090 - - _etext = .; /* End of text section */ - - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; - - RODATA - - /* writeable */ - .data : { /* Data */ - *(.data) - CONSTRUCTORS - } - - . = ALIGN(4096); - __nosave_begin = .; - .data_nosave : { *(.data.nosave) } - . = ALIGN(4096); - __nosave_end = .; - - . = ALIGN(4096); - .data.page_aligned : { *(.data.idt) } - - . = ALIGN(32); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } - - _edata = .; /* End of data section */ - - . = ALIGN(THREAD_SIZE); /* init_task */ - .data.init_task : { *(.data.init_task) } - - /* will be freed after init */ - . = ALIGN(4096); /* Init code and data */ - __init_begin = .; - .init.text : { - _sinittext = .; - *(.init.text) - _einittext = .; - } - .init.data : { *(.init.data) } - . = ALIGN(16); - __setup_start = .; - .init.setup : { *(.init.setup) } - __setup_end = .; - __initcall_start = .; - .initcall.init : { - *(.initcall1.init) - *(.initcall2.init) - *(.initcall3.init) - *(.initcall4.init) - *(.initcall5.init) - *(.initcall6.init) - *(.initcall7.init) - } - __initcall_end = .; - __con_initcall_start = .; - .con_initcall.init : { *(.con_initcall.init) } - __con_initcall_end = .; - SECURITY_INIT - . = ALIGN(4); - __alt_instructions = .; - .altinstructions : { *(.altinstructions) } - __alt_instructions_end = .; - .altinstr_replacement : { *(.altinstr_replacement) } - /* .exit.text is discard at runtime, not link time, to deal with references - from .altinstructions and .eh_frame */ - .exit.text : { *(.exit.text) } - .exit.data : { *(.exit.data) } - . = ALIGN(4096); - __initramfs_start = .; - .init.ramfs : { *(.init.ramfs) } - __initramfs_end = .; - . = ALIGN(32); - __per_cpu_start = .; - .data.percpu : { *(.data.percpu) } - __per_cpu_end = .; - . = ALIGN(4096); - __init_end = .; - /* freed after init ends here */ - - __bss_start = .; /* BSS */ - .bss : { - *(.bss.page_aligned) - *(.bss) - } - . = ALIGN(4); - __bss_stop = .; - - _end = . ; - - /* This is where the kernel creates the early boot page tables */ - . = ALIGN(4096); - pg0 = .; - - /* Sections to be discarded */ - /DISCARD/ : { - *(.exitcall.exit) - } - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } -} diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/fault.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/fault.c index 7d9acce871..b869fad317 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/fault.c +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/fault.c @@ -454,7 +454,8 @@ no_context: printk(KERN_ALERT " printing eip:\n"); printk("%08lx\n", regs->eip); page = ((unsigned long *) cur_pgd)[address >> 22]; - printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page, machine_to_phys(page)); + printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page, + machine_to_phys(page)); /* * We must not directly access the pte in the highpte * case, the page table might be allocated in highmem. @@ -467,7 +468,8 @@ no_context: address &= 0x003ff000; page = machine_to_phys(page); page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT]; - printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n", page, machine_to_phys(page)); + printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n", page, + machine_to_phys(page)); } #endif show_trace(NULL, (unsigned long *)®s[1]); diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/ioremap.c b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/ioremap.c index 5e140759c3..0dc6dd25ab 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/ioremap.c +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/mm/ioremap.c @@ -19,20 +19,29 @@ #ifndef CONFIG_XEN_PHYSDEV_ACCESS -void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) -{ return NULL; } +void * __ioremap(unsigned long phys_addr, unsigned long size, + unsigned long flags) +{ + return NULL; +} void *ioremap_nocache (unsigned long phys_addr, unsigned long size) -{ return NULL; } +{ + return NULL; +} void iounmap(volatile void __iomem *addr) -{ } +{ +} void __init *bt_ioremap(unsigned long phys_addr, unsigned long size) -{ return NULL; } +{ + return NULL; +} void __init bt_iounmap(void *addr, unsigned long size) -{ } +{ +} #else @@ -140,8 +149,8 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l if (!size || last_addr < phys_addr) return NULL; - if (phys_addr >= 0x0 && last_addr < 0x100000) - return isa_bus_to_virt(phys_addr); + if (phys_addr >= 0x0 && last_addr < 0x100000) + return isa_bus_to_virt(phys_addr); /* * Don't remap the low PCI/ISA area, it's always mapped.. @@ -246,8 +255,8 @@ void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) void iounmap(volatile void __iomem *addr) { struct vm_struct *p; - if ((unsigned long)addr <= 0x100000) - return; + if ((unsigned long)addr <= 0x100000) + return; if ((void __force *) addr <= high_memory) return; p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); @@ -276,8 +285,8 @@ void __init *bt_ioremap(unsigned long phys_addr, unsigned long size) if (!size || last_addr < phys_addr) return NULL; - if (phys_addr >= 0x0 && last_addr < 0x100000) - return isa_bus_to_virt(phys_addr); + if (phys_addr >= 0x0 && last_addr < 0x100000) + return isa_bus_to_virt(phys_addr); /* * Don't remap the low PCI/ISA area, it's always mapped.. @@ -320,8 +329,8 @@ void __init bt_iounmap(void *addr, unsigned long size) enum fixed_addresses idx; virt_addr = (unsigned long)addr; - if (virt_addr < 0x100000) - return; + if (virt_addr < 0x100000) + return; if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)) return; offset = virt_addr & ~PAGE_MASK; @@ -345,51 +354,51 @@ void __init bt_iounmap(void *addr, unsigned long size) __direct_mk_pte((physpage) >> PAGE_SHIFT, pgprot) static inline void direct_remap_area_pte(pte_t *pte, - unsigned long address, - unsigned long size, - mmu_update_t **v) + unsigned long address, + unsigned long size, + mmu_update_t **v) { - unsigned long end; - - address &= ~PMD_MASK; - end = address + size; - if (end > PMD_SIZE) - end = PMD_SIZE; - if (address >= end) - BUG(); - - do { - (*v)->ptr = virt_to_machine(pte); - (*v)++; - address += PAGE_SIZE; - pte++; - } while (address && (address < end)); + unsigned long end; + + address &= ~PMD_MASK; + end = address + size; + if (end > PMD_SIZE) + end = PMD_SIZE; + if (address >= end) + BUG(); + + do { + (*v)->ptr = virt_to_machine(pte); + (*v)++; + address += PAGE_SIZE; + pte++; + } while (address && (address < end)); } static inline int direct_remap_area_pmd(struct mm_struct *mm, - pmd_t *pmd, - unsigned long address, - unsigned long size, + pmd_t *pmd, + unsigned long address, + unsigned long size, mmu_update_t **v) { - unsigned long end; - - address &= ~PGDIR_MASK; - end = address + size; - if (end > PGDIR_SIZE) - end = PGDIR_SIZE; - if (address >= end) - BUG(); - do { - pte_t *pte = pte_alloc_map(mm, pmd, address); - if (!pte) - return -ENOMEM; - direct_remap_area_pte(pte, address, end - address, v); - pte_unmap(pte); - address = (address + PMD_SIZE) & PMD_MASK; - pmd++; - } while (address && (address < end)); - return 0; + unsigned long end; + + address &= ~PGDIR_MASK; + end = address + size; + if (end > PGDIR_SIZE) + end = PGDIR_SIZE; + if (address >= end) + BUG(); + do { + pte_t *pte = pte_alloc_map(mm, pmd, address); + if (!pte) + return -ENOMEM; + direct_remap_area_pte(pte, address, end - address, v); + pte_unmap(pte); + address = (address + PMD_SIZE) & PMD_MASK; + pmd++; + } while (address && (address < end)); + return 0; } int __direct_remap_area_pages(struct mm_struct *mm, @@ -397,85 +406,82 @@ int __direct_remap_area_pages(struct mm_struct *mm, unsigned long size, mmu_update_t *v) { - pgd_t * dir; - unsigned long end = address + size; - - dir = pgd_offset(mm, address); - flush_cache_all(); - if (address >= end) - BUG(); - spin_lock(&mm->page_table_lock); - do { - pmd_t *pmd = pmd_alloc(mm, dir, address); - if (!pmd) - return -ENOMEM; - direct_remap_area_pmd(mm, pmd, address, end - address, &v); - address = (address + PGDIR_SIZE) & PGDIR_MASK; - dir++; - - } while (address && (address < end)); - spin_unlock(&mm->page_table_lock); - flush_tlb_all(); - return 0; + pgd_t * dir; + unsigned long end = address + size; + + dir = pgd_offset(mm, address); + flush_cache_all(); + if (address >= end) + BUG(); + spin_lock(&mm->page_table_lock); + do { + pmd_t *pmd = pmd_alloc(mm, dir, address); + if (!pmd) + return -ENOMEM; + direct_remap_area_pmd(mm, pmd, address, end - address, &v); + address = (address + PGDIR_SIZE) & PGDIR_MASK; + dir++; + + } while (address && (address < end)); + spin_unlock(&mm->page_table_lock); + flush_tlb_all(); + return 0; } int direct_remap_area_pages(struct mm_struct *mm, - unsigned long address, - unsigned long machine_addr, - unsigned long size, - pgprot_t prot, - domid_t domid) + unsigned long address, + unsigned long machine_addr, + unsigned long size, + pgprot_t prot, + domid_t domid) { - int i; - unsigned long start_address; + int i; + unsigned long start_address; #define MAX_DIRECTMAP_MMU_QUEUE 130 - mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v; - - u[0].ptr = MMU_EXTENDED_COMMAND; - u[0].val = MMUEXT_SET_FOREIGNDOM; - u[0].val |= (unsigned long)domid << 16; - v = w = &u[1]; - - start_address = address; - - for( i = 0; i < size; i += PAGE_SIZE ) - { - if ( (v - u) == MAX_DIRECTMAP_MMU_QUEUE ) - { - /* Fill in the PTE pointers. */ - __direct_remap_area_pages( mm, - start_address, - address-start_address, - w); + mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v; + + u[0].ptr = MMU_EXTENDED_COMMAND; + u[0].val = MMUEXT_SET_FOREIGNDOM; + u[0].val |= (unsigned long)domid << 16; + v = w = &u[1]; + + start_address = address; + + for(i = 0; i < size; i += PAGE_SIZE) { + if ((v - u) == MAX_DIRECTMAP_MMU_QUEUE) { + /* Fill in the PTE pointers. */ + __direct_remap_area_pages(mm, + start_address, + address-start_address, + w); - if ( HYPERVISOR_mmu_update(u, v - u, NULL) < 0 ) - return -EFAULT; - v = w; - start_address = address; + if (HYPERVISOR_mmu_update(u, v - u, NULL) < 0) + return -EFAULT; + v = w; + start_address = address; + } + + /* + * Fill in the machine address: PTE ptr is done later by + * __direct_remap_area_pages(). + */ + v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot); + + machine_addr += PAGE_SIZE; + address += PAGE_SIZE; + v++; } - /* - * Fill in the machine address: PTE ptr is done later by - * __direct_remap_area_pages(). - */ - v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot); - - machine_addr += PAGE_SIZE; - address += PAGE_SIZE; - v++; - } - - if ( v != w ) - { - /* get the ptep's filled in */ - __direct_remap_area_pages(mm, - start_address, - address-start_address, - w); - if ( unlikely(HYPERVISOR_mmu_update(u, v - u, NULL) < 0) ) - return -EFAULT; - } + if (v != w) { + /* get the ptep's filled in */ + __direct_remap_area_pages(mm, + start_address, + address-start_address, + w); + if (unlikely(HYPERVISOR_mmu_update(u, v - u, NULL) < 0)) + return -EFAULT; + } - return 0; + return 0; } diff --git a/linux-2.6.10-rc2-xen-sparse/arch/xen/kernel/Makefile b/linux-2.6.10-rc2-xen-sparse/arch/xen/kernel/Makefile index 3e987bee23..8924b15f66 100644 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/kernel/Makefile +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/kernel/Makefile @@ -4,8 +4,10 @@ XENARCH := $(subst ",,$(CONFIG_XENARCH)) -$(obj)/vmlinux.lds: - @ln -fsn $(srctree)/arch/$(ARCH)/$(XENARCH)/kernel/vmlinux.lds $@ +CPPFLAGS_vmlinux.lds += -U$(XENARCH) + +$(obj)/vmlinux.lds.S: + @ln -fsn $(srctree)/arch/$(XENARCH)/kernel/vmlinux.lds.S $@ extra-y += vmlinux.lds diff --git a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h index 8f6c7b2daa..85edefdf30 100644 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h @@ -28,6 +28,7 @@ void __init machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c) clear_bit(X86_FEATURE_DE, c->x86_capability); clear_bit(X86_FEATURE_PSE, c->x86_capability); clear_bit(X86_FEATURE_PGE, c->x86_capability); + clear_bit(X86_FEATURE_SEP, c->x86_capability); clear_bit(X86_FEATURE_MTRR, c->x86_capability); clear_bit(X86_FEATURE_FXSR, c->x86_capability); } -- 2.30.2